﻿using System;

namespace dotHTML.HTML {
    /// <summary>
    /// Represents deleted text in an HTML document.
    /// </summary>
    [Serializable]
    public class Del : Element {
        private string _cite;
        private DateTime? _datetime;

        /// <summary>
        /// Determines the citation URL of the text.
        /// </summary>
        public string Cite {
            get { return _cite; }
            set { _cite = value; }
        }

        /// <summary>
        /// Determines the date and time at which the text was deleted.
        /// </summary>
        public DateTime? DateTime {
            get { return _datetime; }
            set { _datetime = value; }
        }

        /// <summary>
        /// Gets a formatted string of all local attributes of this element
        /// (not including the base attributes).
        /// </summary>
        /// <param name="sb">The StringBuilder to write this element's
        /// attribute data to.</param>
        protected override void WriteLocalAttributes(System.Text.StringBuilder sb) {
            AttributeWriter.Write(sb, _cite, "cite");
            AttributeWriter.Write(sb, _datetime, "datetime");
        }
    }
}
